@import './var.css';
@import 'element-plus/theme-chalk/dark/css-vars.css';

.reset-margin [class*='el-icon'] + span {
  margin-left: 2px !important;
}

// 解决抽屉弹出时，body宽度变化的问题
.el-popup-parent--hidden {
  width: 100% !important;
}

// 解决表格内容超过表格总宽度后，横向滚动条前端顶不到表格边缘的问题
.el-scrollbar__bar {
  display: flex;
  justify-content: flex-start;
}

/* nprogress 适配 element-plus 的主题色 */
#nprogress {
  & .bar {
    background-color: var(--el-color-primary) !important;
  }

  & .peg {
    box-shadow: 0 0 10px var(--el-color-primary),
    0 0 5px var(--el-color-primary) !important;
  }

  & .spinner-icon {
    border-top-color: var(--el-color-primary);
    border-left-color: var(--el-color-primary);
  }
}

.el-dialog {
  border-radius: 3px;
  transition: width 0.3s ease;

  &__header {
    height: 50px;
    line-height: 50px;
    margin: 0;
    padding: 0 12px;
    user-select: none;
    border-bottom: 1px solid var(--el-border-color);

    .el-dialog__headerbtn {
      display: flex;
      top: 0;
      height: 50px;
      line-height: 50px;
      align-items: center;
      justify-content: center;
    }
  }

  &__body {
    padding: 20px;
    overflow: auto;
    max-height: calc(100vh - 150px);
  }

  &__footer {
    padding: 12px;
    border-top: 1px solid var(--el-border-color);
  }
}

.el-overlay {
  overflow: hidden;

  .el-overlay-dialog {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    position: unset !important;

    .el-dialog {
      margin: 0 auto !important;
    }
  }
}

.el-table {
  font-size: 13px;

  &__header {
    tr {
      th {
        color: var(--el-table-text-color);
        background-color: var(--el-table-border-color) !important;
      }
    }
  }
}

.el-message {
  &.el-message--success,
  &.el-message--error,
  &.el-message--info,
  &.el-message--warning {
    border: 0;
    padding: 12px 20px 12px 15px;
    background-color: #ffffff;
    box-shadow: 0 0 15px 5px rgb(0 0 0 / 15%);

    .el-message__content {
      font-size: 13px;
      color: var(--el-text-color-regular);
    }
  }
}
